﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for Helper
/// </summary>
public class Helper
{
	public Helper()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public static string getQuerystr(string paramater)
    {
        string tmp = "";
        try
        {
            tmp = System.Web.HttpContext.Current.Request.QueryString[paramater];
        }
        catch (Exception ex)
        {
            tmp = "";
            throw new Exception(ex.Message);
        }
        return tmp;
    }

    public static int getQuery(string paramater)
    {
        int result = 0;
        try
        {
            string tmp = "";
            tmp = System.Web.HttpContext.Current.Request.QueryString[paramater];
            if (tmp != null && !tmp.Equals(""))
            {
                result = int.Parse(tmp);
            }
        }
        catch (Exception ex)
        {
            result = 0;
            throw new Exception(ex.Message);
        }
        return result;
    }
}
